home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / mathematica / tex-mma.tar_z / tex-mma / PSTeXpro.m < prev    next >
Text File  |  1991-02-25  |  1KB  |  52 lines

  1. (* 2/25/1991 Dan Dill dan@chem.bu.edu *)
  2.  
  3. (* See also PSTeX.m, which does *not* include the prolog in the file. *)
  4.  
  5. PSTeX::usage = "PSTeX[-graphics-, \"file\"].
  6.  
  7. Process a graphics object to a PostScript file for inclusion is a TeX document
  8. (using \\psfig).  Quotes are required around the file name and suffix `.ps' is
  9. added.  The graphic object is preprocessed through psfix to prepend the
  10. Mathematica PostScript precedures to the file, so that it can be included in
  11. the TeX document directly (for example, with \\psfig{figure=file.ps}).  The
  12. height of the scaled graphic is PSTeXHeight (default 100) and the font size
  13. is PSTeXFontsize (default 7), both in big points (72 bp per inch).  For
  14. example,
  15.  
  16. \n
  17. \n
  18. \t PSTeX[myplot, \"p4/myplot\"]
  19. \n
  20. \n
  21.   will convert the graphics object myplot to the PostScript file myplot.ps in
  22. the subdirectory p4 of the current directory.
  23.  
  24. \n
  25. \n
  26.   Note: PSTeX yields a graphic scaled to height PSTeXHeight and without
  27. centering or margins, and so is not generally suitable for printing.  Use
  28. PSFile to produce a graphic in a file, centered and scaled to fill the whole
  29. page."
  30.  
  31. PSTeX::file = "Graphics being processed (with prolog) to file \"`1`\".";
  32.  
  33. PSTeXFontsize = 7;
  34. PSTeXHeight = 100;
  35.  
  36. PSTeX[g_, f_String] := Block[{filename},
  37.     filename = StringJoin[f, ".ps"];
  38.     Message[PSTeX::file, filename];
  39.     Display[StringJoin[
  40.         "! psfix",
  41.         " | ",
  42.         "addBBoxpro",
  43.         " ",
  44.         ToString[PSTeXHeight],
  45.         " ",
  46.         ToString[PSTeXFontsize],
  47.         " > ",
  48.         filename
  49.         ], g
  50.     ];
  51. ];
  52.